package com.vhans.db.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.vhans.core.domain.BCompetition;
import com.vhans.db.model.dto.ConditionDTO;
import com.vhans.db.model.vo.agreement.*;
import com.vhans.db.model.vo.agreement.competition.CompetitionAgreementVO;
import com.vhans.db.model.vo.agreement.competition.CompetitionInfoVO;
import com.vhans.db.model.vo.agreement.competition.CompetitionVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 【赛事】Mapper接口
 *
 * @author vhans
 * @date 2023-04-10
 */
@Repository
public interface BCompetitionMapper extends BaseMapper<BCompetition> {
    /**
     * 查询赛事列表
     *
     * @param condition 条件
     * @return 赛事列表
     */
    List<CompetitionVO> selectCompetitionVO(@Param("condition") ConditionDTO condition);

    /**
     * 根据id查询赛事信息
     *
     * @param competitionId 赛事id
     * @return 赛事信息
     */
    CompetitionInfoVO selectCompetitionInfoById(@Param("competitionId") Integer competitionId);

    /**
     * 查看首页赛事列表
     *
     * @return 首页赛事列表
     */
    List<AgreementHomeListVO> listCompetitionHomeVO();

    /**
     * 根据id查询约起中心赛事
     *
     * @param competitionId 赛事id
     * @return 首页赛事
     */
    CompetitionAgreementVO selectCompetitionAgreementById(Integer competitionId);

    /**
     * 查询上一篇赛事
     *
     * @param competitionId 赛事id
     * @return 上一篇赛事
     */
    AgreementPaginationVO selectLastCompetition(Integer competitionId);

    /**
     * 查询下一篇赛事
     *
     * @param competitionId 赛事id
     * @return 下一篇赛事
     */
    AgreementPaginationVO selectNextCompetition(Integer competitionId);

    /**
     * 查询过期的赛事
     */
    List<Integer> selectCompetitionExpire();
}
